home *** CD-ROM | disk | FTP | other *** search
/ C/C++ Users Group Library 1996 July / C-C++ Users Group Library July 1996.iso / listings / v_12_11 / allison / tstr2.cpp < prev    next >
C/C++ Source or Header  |  1994-09-05  |  299b  |  21 lines

  1. LISTING 6 - Tests string class with deep copy
  2. // tstr2.cpp
  3. #include <iostream.h>
  4. #include "str2.h"
  5.  
  6. main()
  7. {
  8.     string s("hello"), t = s;
  9.  
  10.     t[0] = 'j';
  11.     cout << "s == " << s << endl;
  12.     cout << "t == " << t << endl;
  13.     return 0;
  14. }
  15.  
  16. /* Output:
  17. s == hello
  18. t == jello
  19. */
  20.  
  21.